<template>
	<div>
		<div class="kk" style="width: 100%;height: 200px;"></div>
		<div style="width: 400px;margin-left: calc(50% - 200px);">
			<div>菜系编号:
				<el-input v-model="type.vtypeid" clearable></el-input>
			</div>
			<div style="margin-top: 50px;">菜系名称:
				<el-input v-model="type.vtypename" clearable></el-input>
			</div>
			<div style="text-align: center;margin-top: 50px;">
				<el-button @click='addtype' type="danger">提交</el-button>
			</div>
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return {
				type:{
					vtypeid:'',
					vtypename:''
				}
			}
		},
		methods:{
			addtype:function(){
				this.$http.post('http://localhost:8080/OrderSystemServer/order/veg/addtype',this.type)
				.then((response)=>{
					if(response.data.isOK)
					{
						this.$message({
									type: 'success',
									message: '添加成功'
								});
					}
					else{
						this.$message({
									type: 'error',
									message: '添加失败，可能类别编号重复'
								});
					}
				});
			}
		}
	}
</script>

<style>
</style>